export const HOME_ACTION_TYPES = {
    // ROOT
    ROOT_SET_NOTIFY: 'ROOT_SET_NOTIFY',
    ROOT_SET_ACTIVE_TAB: 'ROOT_SET_ACTIVE_TAB',
    ROOT_SET_ACTIVE_PAGE_OF_ACTIVE_TAB: 'ROOT_SET_ACTIVE_PAGE_OF_ACTIVE_TAB',
    ROOT_SET_ACTIVE_TAB_COLLAPSE_COL: 'ROOT_SET_ACTIVE_TAB_COLLAPSE_COL',

    // COMMON
    COMMON_SET_ALL_PLANS: 'COMMON_SET_ALL_PLANS',
    COMMON_SET_ALL_PAGES: 'COMMON_SET_ALL_PAGES',
    COMMON_SET_ALL_ENVS: 'COMMON_SET_ALL_ENVS',
    COMMON_SET_ALL_COOKIES: 'COMMON_SET_ALL_COOKIES',
    COMMON_FORCE_RELOAD_ALL_PLANS: 'COMMON_FORCE_RELOAD_ALL_PLANS',

    // PROGRESS
    PROGRESS_SET_ACTIVE_PLAN: 'PROGRESS_SET_ACTIVE_PLAN',
    PROGRESS_SET_ACTIVE_PLAN_SUITES: 'PROGRESS_SET_ACTIVE_PLAN_SUITES',
    PROGRESS_SET_ACTIVE_PLAN_LOGS: 'PROGRESS_SET_ACTIVE_PLAN_LOGS',
    PROGRESS_SET_ACTIVE_SUITE: 'PROGRESS_SET_ACTIVE_SUITE',
    PROGRESS_SET_ACTIVE_SUITE_LOGS: 'PROGRESS_SET_ACTIVE_SUITE_LOGS',
    PROGRESS_SET_ACTIVE_SUITE_STEP_LIST: 'PROGRESS_SET_ACTIVE_SUITE_STEP_LIST',
    PROGRESS_FORCE_RELOAD_ACTIVE_PLAN_LOGS: 'PROGRESS_FORCE_RELOAD_ACTIVE_PLAN_LOGS',

    // RUNNER
    RUNNER_SET_ACTIVE_SUITE: 'RUNNER_SET_ACTIVE_SUITE',

    // SUITE
    SUITE_SET_ACTIVE_SUITE: 'SUITE_SET_ACTIVE_SUITE',
    SUITE_FORCE_RELOAD_SUIT_LIST: 'SUITE_FORCE_RELOAD_SUIT_LIST',

    // ELEMENT
    ELEMENT_SET_ACTIVE_NODE: 'ELEMENT_SET_ACTIVE_NODE',

    // AJAX

    // MOCK
    MOCK_SET_ACTIVE_AJAX_ID: 'MOCK_SET_ACTIVE_AJAX_ID',

    // CONFIG
    ROOT_SET_ACTIVE_CONFIG_TYPE: 'ROOT_SET_ACTIVE_CONFIG_TYPE',

    // LOG
    LOG_SET_STAT: 'LOG_SET_STAT',

    // PLAN
    PLAN_ADD_PLAN: 'PLAN_ADD_PLAN',
    PLAN_CLEAR_ADDED_PLANS: 'PLAN_CLEAR_ADDED_PLANS',
    PLAN_SET_ACTIVE_PLAN: 'PLAN_SET_ACTIVE_PLAN',
    PLAN_SET_ACTIVE_PLAN_SUITES: 'PLAN_SET_ACTIVE_PLAN_SUITES',
    PLAN_CHANGE_ACTIVE_PLAN_FIELD: 'PLAN_CHANGE_ACTIVE_PLAN_FIELD',

    // STEP COLLECTION
    STEP_COLLECTION_SET_ACTIVE_STEP_COLLECTION: 'STEP_COLLECTION_SET_ACTIVE_STEP_COLLECTION',
    STEP_COLLECTION_RELOAD_LIST: 'STEP_COLLECTION_RELOAD_LIST',
}

// ROOT
export const genSetActiveTab = (tab) => ({ type: HOME_ACTION_TYPES.ROOT_SET_ACTIVE_TAB, tab })
export const genSetNotify = (notifyType, message) => ({ type: HOME_ACTION_TYPES.ROOT_SET_NOTIFY, notifyType, message })
export const genSetActivePageOfActiveTab = (page) => ({ type: HOME_ACTION_TYPES.ROOT_SET_ACTIVE_PAGE_OF_ACTIVE_TAB, page })
export const genSetCollapseColOfActiveTab = (colIndex, collapse) => ({ type: HOME_ACTION_TYPES.ROOT_SET_ACTIVE_TAB_COLLAPSE_COL, colIndex, collapse })

// COMMON
export const genCommonSetAllPlans = plans => ({ type: HOME_ACTION_TYPES.COMMON_SET_ALL_PLANS, plans })
export const genCommonSetAllPages = pages => ({ type: HOME_ACTION_TYPES.COMMON_SET_ALL_PAGES, pages })
export const genCommonSetAllEnvs = envs => ({ type: HOME_ACTION_TYPES.COMMON_SET_ALL_ENVS, envs })
export const genCommonSetAllCookies = cookies => ({ type: HOME_ACTION_TYPES.COMMON_SET_ALL_COOKIES, cookies })
export const genCommonForceReloadAllPlans = () => ({ type: HOME_ACTION_TYPES.COMMON_FORCE_RELOAD_ALL_PLANS })

// PROGRESS
export const genProgressSetActivePlan = plan => ({ type: HOME_ACTION_TYPES.PROGRESS_SET_ACTIVE_PLAN, plan })
export const genProgressSetActivePlanSuites = suites => ({ type: HOME_ACTION_TYPES.PROGRESS_SET_ACTIVE_PLAN_SUITES, suites })
export const genProgressForceReloadActiveSuiteLogs = () => ({ type: HOME_ACTION_TYPES.PROGRESS_FORCE_RELOAD_ACTIVE_PLAN_LOGS })
export const genProgressSetActivePlanLogStat = logStat => ({ type: HOME_ACTION_TYPES.PROGRESS_SET_ACTIVE_PLAN_LOGS, logStat })
export const genProgressSetActiveSuite = suite => ({ type: HOME_ACTION_TYPES.PROGRESS_SET_ACTIVE_SUITE, suite })
export const genProgressSetActiveSuiteLogs = logs => ({ type: HOME_ACTION_TYPES.PROGRESS_SET_ACTIVE_SUITE_LOGS, logs })
export const genProgressSetActiveSuiteStepList = stepList => ({ type: HOME_ACTION_TYPES.PROGRESS_SET_ACTIVE_SUITE_STEP_LIST, stepList })

// RUNNER
export const genRunnerSetActiveSuite = (suite) => ({ type: HOME_ACTION_TYPES.RUNNER_SET_ACTIVE_SUITE, suite })

// SUITE
export const genSuiteSetActiveSuite = (suite) => ({ type: HOME_ACTION_TYPES.SUITE_SET_ACTIVE_SUITE, suite })
export const genSuiteForceReloadSuitList = () => ({ type: HOME_ACTION_TYPES.SUITE_FORCE_RELOAD_SUIT_LIST })

// STEP COLLECTION
export const genStepCollectionSetActiveStepCollection = stepCollection => ({ type: HOME_ACTION_TYPES.STEP_COLLECTION_SET_ACTIVE_STEP_COLLECTION, stepCollection })

// ELEMENT
export const genElementSetActiveNode = (node) => ({ type: HOME_ACTION_TYPES.ELEMENT_SET_ACTIVE_NODE, node })

// AJAX

// MOCK
export const genMockSetActiveAjaxId = (ajaxId) => ({ type: HOME_ACTION_TYPES.MOCK_SET_ACTIVE_AJAX_ID, ajaxId })

// CONFIG
export const genSetActiveConfigType = (configType) => ({ type: HOME_ACTION_TYPES.ROOT_SET_ACTIVE_CONFIG_TYPE, configType })

// LOG
export const genSetLogStat = stat => ({ type: HOME_ACTION_TYPES.LOG_SET_STAT, stat })

// PLAN
export const genPlanAddPlan = plan => ({ type: HOME_ACTION_TYPES.PLAN_ADD_PLAN, plan })
export const genPlanSetActivePlan = plan => ({ type: HOME_ACTION_TYPES.PLAN_SET_ACTIVE_PLAN, plan })
export const genPlanClearAddedPlans = () => ({ type: HOME_ACTION_TYPES.PLAN_CLEAR_ADDED_PLANS })
export const genPlanSetActivePlanSuites = plan => ({ type: HOME_ACTION_TYPES.PLAN_SET_ACTIVE_PLAN_SUITES, plan })
export const genPlanChangeActivePlanField = (field, value) => ({ type: HOME_ACTION_TYPES.PLAN_CHANGE_ACTIVE_PLAN_FIELD, field, value })